package draft;


/**
 * League.java
 * 
 * Represents a 
 * 
 * @author Doug Hyde, hyde@wustl.edu
 * 
 */
public class League {

	public static int size;
	public final Team teams[];
	
	public int movesLeft;
	
	public League () {
		teams = new Team[size];
		for (int i=0; i<size; ++i) {
			teams[i] = new Team("Team "+i);
		}
		movesLeft = FantasyManager.NUM_PICKS * size;
	}
	
	public void addPlayer (Player p, int team) {
		teams[team].addPlayer(p);
		--movesLeft;
	}
	
	public void removePlayer (Player p, int team) {
		teams[team].removePlayer(p);
		++movesLeft;
	}
	
	
	public String toString () {
		StringBuilder s = new StringBuilder();
		for (Team t: teams)
			s.append(t + "\n");
		s.append("Available: ");
		for (Player p : FantasyManager.players)
			s.append (p + ", ");
			
		s.append("\n");
		return s.toString();
	}
}
